//
//  CFProgressHUDIndeterminateIndicatorView.m
//  CFProgressHUD
//
//  Created by 千域互联 on 2018/3/18.
//  Copyright © 2018年 千域互联. All rights reserved.
//

#import "CFProgressHUDIndeterminateIndicatorView.h"

@implementation CFProgressHUDIndeterminateIndicatorView

- (instancetype)init
{
    UIActivityIndicatorView *activityIndicatorView = [[UIActivityIndicatorView alloc] initWithActivityIndicatorStyle:UIActivityIndicatorViewStyleWhiteLarge];
    [activityIndicatorView startAnimating];
    
    self = [super initWithContentView:activityIndicatorView];
    return self;
}

- (void)setUpForHUDStyle:(CFProgressHUDStyle)style vibrancyEnabled:(BOOL)vibrancyEnabled
{
    [super setUpForHUDStyle:style vibrancyEnabled:vibrancyEnabled];
    if (style != CFProgressHUDStyleDark) {
        self.color = [UIColor whiteColor];
    }else {
        self.color = [UIColor whiteColor];
    }
}

- (void)setColor:(UIColor *)color
{
    [(UIActivityIndicatorView *)self.contentView setColor:color];
}
- (void)updateAccessibility
{
    self.accessibilityLabel = NSLocalizedString(@"Indeterminate progress", );
}

@end
